/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package redis.pipe;

/**
 *
 * @author dell
 */
public class Table 
{
public static class Column
{
//columns_______________________________________________________________________
public String columnname;
public String jdbctype;
public String javatype;
//functions_____________________________________________________________________
     //constructor______________________________________________________________
public Column()
{
    
}
public Column(String columnname,String jdbctype,String javatype)
{
     this.columnname=columnname;
     this.javatype=javatype;
     this.jdbctype=jdbctype;
}
     //getter___________________________________________________________________
public String getColumnname() 
{
     return columnname;
}
public String getJdbctype() 
{
     return jdbctype;
}
public String getJavatype() 
{
     return javatype;
}
     //setter___________________________________________________________________
public void setColumnname(String columnname) 
{
     this.columnname = columnname;
}
public void setJdbctype(String jdbctype) 
{
     this.jdbctype = jdbctype;
}
public void setJavatype(String javatype) 
{
     this.javatype = javatype;
}
     //toString_________________________________________________________________
@Override
public String toString()
{
       return columnname+"\t"+jdbctype+"\t"+javatype;   
}
}
//columns_______________________________________________________________________    
protected String tablename;
protected int target;
protected Column[] columns;
//functions_____________________________________________________________________    
     //constructor______________________________________________________________
public Table()
{
     
}
public Table(String tablename,int target,int size)
{
     this.tablename=tablename;
     this.target=target;
     this.columns=new Column[size];
}
     //getter___________________________________________________________________
public String getTablename() 
{
     return tablename;
}
public int getTarget()
{
     return target;
}
public Column[] getColumns() 
{
     return columns;
}
     //setter___________________________________________________________________
public void setTablename(String tablename) 
{
     this.tablename = tablename;
}
public void setTarget(int target) 
{
     this.target = target;
}
public void setColumns(Column[] columns) 
{
     this.columns = columns;
}
     //toString_________________________________________________________________
@Override
public String toString()
{
     String str=tablename+"\t[";
     if(this.columns!=null)
     for(int i=0;i<this.columns.length;i++) str+=columns[i]+"\t";
     str+="]\t";
     return str;
}
}
